package com.shigen.demo.controller;

import com.shigen.demo.vo.DateVo;
import com.shigen.demo.vo.DateVoTest;
import com.shigen.demo.vo.DesensitizationVo;
import com.shigen.demo.vo.SensitiveVo;
import java.util.Date;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shigenfu
 * @date 2023/9/11 10:37 下午
 */
@RestController
@RequestMapping(value = "desensitization")
public class DesensitizationTestController {


    @GetMapping(value = "test")
    public DesensitizationVo test() {
        DesensitizationVo desensitizationVo = new DesensitizationVo()
            .setAddress("湖北省武汉市江夏区武昌大道123号")
            .setBankCard("12345678999999999")
            .setCarLicense("鄂C 123456")
            .setChineseName("张三")
            .setCustomer("hello, 这是自定义的脱敏信息")
            .setEmail("123456@qq.com")
            .setFixedPhone("027-8989899")
            .setIdCard("123432199810093456")
            .setIpv4("192.168.10.54")
            .setPassword("password123456!()@#$")
            .setMobilePhone("12456787654");
        return desensitizationVo;
    }

    @GetMapping(value = "newTest")
    public SensitiveVo newTest() {
        SensitiveVo sensitiveVo = new SensitiveVo()
            .setAddress("湖北省武汉市江夏区武昌大道123号")
            .setBankCard("12345678999999999")
            .setCarLicense("鄂A123456")
            .setChineseName("张三")
            .setCustomer("hello, 这是shigen自定义的脱敏信息")
            .setEmail("123456@qq.com")
            .setFixedPhone("027-8989899")
            .setIdCard("123432199810093456")
            .setIpv4("192.168.10.54")
            .setPassword("password123456!()@#$")
            .setMobilePhone("12456787654");
        return sensitiveVo;
    }

    @GetMapping(value = "testDate")
    public Object testDate() {
        return new DateVo().setDate(new Date());
    }

    @GetMapping(value = "testDate1")
    public Object testDateOne() {
        return new DateVoTest().setDate(new Date());
    }
}
